<?php

/**
 * @author Patricio Mac Adden <pmacadden@cespi.unlp.edu.ar>
 */
class ValidatorFactory
{
  public static function replaceValidators(sfForm $form)
  {
    foreach ($form->getWidgetSchema()->getFields() as $name => $widget)
    {
      if ($widget instanceof mtWidgetFormInputDate)
      {
        $form->setValidator($name, self::getDateValidator());
      }
      

    }
  }
  
  public static function getDateValidator()
  {
    return new mtValidatorDateString();
  }
}